home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PVDRIVER
/
WLBPS.ZIP
/
WLBPS.PRG
< prev
next >
Wrap
Text File
|
1993-01-12
|
3KB
|
87 lines
**********************************************************************
* ┌───────────────────────────────────┐
* │ ▐███▌ ████ ▀██████ █████ │
* │ █████▐████▌ ▀████ █████ │
* │ █▐████▌█████ ▀██ █████ │
* │ ▐█▌█████▐████▌ ▄█ ▀ █████ │
* │ ███▐████▌█████ ■███ █████ │
* │ ▐███▌█████▐████▌ ▀█ ▄ █████ │
* │ █████▐████▌█████ ▄██ █████ │
* │ ▐█████▌█████▐████▌ ▄████ █████ │
* │ ███████▐████▌█████ ▄██████ █████ │
* ├───────────────────────────────────┤
* │ Micro Endeavors, Inc. │
* │ 3150 Township Line Road │
* │ Drexel Hill, PA 19026 │
* └───────────────────────────────────┘
**********************************************************************
PRIVATE ALL LIKE l_*
SET LIBRARY TO (SYS(2004)+"foxtools")
l_getwdir = RegFn("GetWindowsDirectory", "@CI", "I")
l_wps = RegFn("WriteProfileString","CCC","I")
l_bigstr = REPL(CHR(0), 144) && set up a big string
l_retlen = CallFn(l_getwdir, @l_bigstr, 144)
l_pfx = LEFT(l_bigstr, l_retlen)
CREATE CURSOR ps1 (long C(80))
APPEND FROM (l_pfx+"\WIN.INI") TYPE SDF
LOCATE FOR long = "[windows]"
LOCATE REST FOR long = "device="
l_pstring = three21(SUBSTR(long,8),.T.)
l_lstring = SUBSTR(long,8,10)
LOCATE FOR long = "[devices]"
DIMENSION l_pplist[100],l_pslist[100]
STORE 1 TO l_i
SKIP
SCAN REST
IF EMPTY(long)
EXIT
ENDIF
l_pplist[l_i] = three21(long)
l_pslist[l_i] = long
l_i = l_i + 1
ENDSCAN
DIMENSION l_pplist[l_i-1],l_pslist[l_i-1]
* need to set at current
l_ppprint = MAX(1,ASCAN(l_pslist,l_lstring))
DO wlbps.SPR
SET LIBRARY TO
USE IN ps1
RETURN
PROCEDURE Vrbprint
IF l_rbprint = 2
_curobj = OBJNUM(l_ppprint)
ENDIF
RETURN
PROCEDURE Vpraction
IF l_praction = 1 AND l_rbprint = 2
l_pstring = TRIM(l_pslist[l_ppprint])
l_pstring = STUFF(l_pstring,AT("=",l_pstring),1,",")
= CallFn(l_wps,"windows","device",l_pstring)
ENDIF
RETURN
PROCEDURE Vppprint
IF l_rbprint != 2
l_rbprint = 2
SHOW GET l_rbprint
ENDIF
PROCEDURE three21
PARAMETER r_stng,r_cur
PRIVATE ALL LIKE r_*
r_s1 = LEFT(r_stng,AT(IIF(r_cur,",","="),r_stng)-1)
r_s2 = TRIM(r_stng)
r_s2 = SUBST(r_s2,RAT(",",r_s2)+1)
IF r_s2 = "LPT3:"
r_s2 = "mei1/printq_0 (LPT3:)"
ENDIF
IF r_cur
RETURN "(currently "+r_s1+" on "+r_s2+")"
ELSE
RETURN r_s1+" on "+r_s2
ENDIF